package repositorio;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Calendar;


/**
 * The persistent class for the RESERVA database table.
 * 
 */
@Entity
@NamedQuery(name="Reserva.findAll", query="SELECT r FROM Reserva r")
public class Reserva implements Serializable {
	private static final long serialVersionUID = 1L;
	private int idReserva;
	private Calendar fechaE;
	private Calendar fechaS;
	private Persona persona;
	private Habitacion habitacion;

	public Reserva() {
	}


	@Id
	@SequenceGenerator(name="RESERVA_IDRESERVA_GENERATOR" )
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="RESERVA_IDRESERVA_GENERATOR")
	@Column(name="ID_RESERVA")
	public int getIdReserva() {
		return this.idReserva;
	}

	public void setIdReserva(int idReserva) {
		this.idReserva = idReserva;
	}


	@Temporal(TemporalType.DATE)
	@Column(name="FECHA_E")
	public Calendar getFechaE() {
		return this.fechaE;
	}

	public void setFechaE(Calendar fechaE) {
		this.fechaE = fechaE;
	}


	@Temporal(TemporalType.DATE)
	@Column(name="FECHA_S")
	public Calendar getFechaS() {
		return this.fechaS;
	}

	public void setFechaS(Calendar fechaS) {
		this.fechaS = fechaS;
	}


	//uni-directional one-to-one association to Persona
	@OneToOne
	@JoinColumn(name="ID_RESERVA", referencedColumnName="ID_RESERVA")
	public Persona getPersona() {
		return this.persona;
	}

	public void setPersona(Persona persona) {
		this.persona = persona;
	}


	//bi-directional many-to-one association to Habitacion
	@ManyToOne
	@JoinColumn(name="NROHABITACION")
	public Habitacion getHabitacion() {
		return this.habitacion;
	}

	public void setHabitacion(Habitacion habitacion) {
		this.habitacion = habitacion;
	}

}